﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AppDialogBox
{
    public class AppDialogWrapper
    {
        public static DialogResult InputBox(string title, string promptText, ref string value, bool isPassword)
        {
            InputBox inputBox = new InputBox(title, promptText, isPassword);
            
            DialogResult dialogResult = inputBox.ShowDialog();
            value = inputBox.textBox.Text;
            return dialogResult;
        }

        public static DialogResult PromptBox(string text, string caption, MessageBoxButtons buttons)
        {
            PromptBox promptBox = new PromptBox(text, caption, buttons);

            DialogResult dialogResult = promptBox.ShowDialog();
            return dialogResult;
        }

        public static DialogResult PromptBox(string text, string caption)
        {
            return AppDialogWrapper.PromptBox(text, caption, MessageBoxButtons.OK);
        }

        public static DialogResult testIt()
        {
            //short message box
            AppDialogWrapper.PromptBox("body text", "Title text", MessageBoxButtons.OK);

            // long message box
            AppDialogWrapper.PromptBox("body text is the most important one", "Title text", MessageBoxButtons.OK);
            
            // average YesNoCancel
            AppDialogWrapper.PromptBox("body text is the most important one", "Title text", MessageBoxButtons.YesNoCancel);

            // very big OKCancel
            return AppDialogWrapper.PromptBox("Save the following data for " + "hotmail" + "? \nusername: " + "ohad_lights@hotmail.com" + "\npassword: " + "timuti" + "\n" + "optional field" + ": " + "optional data", "Confirm Change", MessageBoxButtons.OKCancel);
        }
      
    }
}
